home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
UTILITY
/
TASEXAM6.ARJ
/
BASE-NH.TAS
< prev
next >
Wrap
Text File
|
1992-03-08
|
5KB
|
146 lines
{
This script is geared toward investors who like to buy stocks at or near
new highs, as they emerge from basing patterns. It finds and graphs all
stocks which are making new highs, and all stocks which are within 5%
of their high AND have been in a narrow trading range for a period of time.
"Narrow" is <15% for at least 30 days, <20% for at least 40 days, or <25%
for at least 60 days. Stocks which meet none of the above conditions will
be passed.
The script then counts how many days the stock has been trading in ranges
<15%, <20%, and <25%. It reports these values on the graph. The graph
also draws lines defining any base <15% for greater than 30 days, or any
<20% base for greater than 40 days, or any base <25% for greater than
60 days. Stocks making new highs will not always have base lines drawn
on the graph, as there may be none which meet one of the conditions above.
Bases of <15% will be defined with red lines, <20% with green lines, and
<25% with blue lines.
The volume graph tells volume today, 50MA of volume, % today vs average,
prior 5MA % of 50MA, and prior 10MA % of 50MA. The prior 5MA and 10MA
do not include today, rather they end yesterday. They are intended to
show how volume behaved immediately prior to today's action.
Most data is displayed on the screen during processing, and it is saved
in the output file "BASE-NH.LST".
Written 3/6/92 by Tom Rategan. Prodigy PMGV10A
}
#max_quotes 255
#output_file 'BASE-NH.LST'
if first_ticker then begin
writeln(
' ********* New highs and possible near base breakouts. *********
');
writeln(
' Days in Range');
writeln(
' Name Close Change %OH <15% <20% <25% Vol %Vol '
);
writeln(
' ---- ----- ------ --- ---- ---- ---- --- ---- '
);
end;
if quote_count < 65 then return;
hiqc : array;
qc = (quote_count-2);
hiqc = hhv(c,qc);
if c = hiqc then goto loop15;
if c < (hiqc*.95) then return;
hi30 : array;
lo30 : array;
hi30 = hhv(c,30);
lo30 = llv(c,30);
hi40 : array;
lo40 : array;
hi40 = hhv(c,40);
lo40 = llv(c,40);
hi60 : array;
lo60 : array;
hi60 = hhv(c,60);
lo60 = llv(c,60);
r30 = (1-(lo30/hi30))*100;
r40 = (1-(lo40/hi40))*100;
r60 = (1-(lo60/hi60))*100;
if r30 <= 15 or r40 <= 20 or r60 <= 25 then goto loop15;
return;
:loop15
t15 = 1;
:loop15a;
gosub howlong15;
if t15 = (qc*(-1)) then goto loop20;
if ((1-(c[t15]/hiqc))*100) > 15 then goto loop20 else goto loop15a;
:howlong15
t15 = t15-1;
return;
:loop20
t15=(t15+1)*(-1);
t20 = -(t15);
:loop20a
gosub howlong20;
if t20 = (qc*(-1)) then goto loop25;
if ((1-(c[t20]/hiqc))*100) > 20 then goto loop25 else goto loop20a;
:howlong20
t20 = t20-1;
return;
:loop25
t20 =(t20+1)*(-1);
t25 = -(t20);
:loop25a
gosub howlong25;
if t25 = (qc*(-1)) then goto graphit;
if ((1-(c[t25]/hiqc))*100) > 25 then goto graphit else goto loop25a;
:howlong25
t25 = t25-1;
return;
:graphit
t25 = (t25+1)*(-1);
hi15 : array;
lo15 : array;
hi15 = hhv(c,t15);
lo15 = llv(c,t15);
hi20 : array;
lo20 : array;
hi20 = hhv(c,t20);
lo20 = llv(c,t20);
hi25 : array;
lo25 : array;
hi25 = hhv(c,t25);
lo25 = llv(c,t25);
v50 : array;
v50 = mov(v,50,'s');
vv50 = ((v[0]/v50[0])*100);
v5 = (v[-1]+v[-2]+v[-3]+v[-4]+v[-5])/5
v5v50 = ((v5/v50[0])*100);
v10 = (v[-1]+v[-2]+v[-3]+v[-4]+v[-5]+v[-6]+v[-7]+v[-8]+v[-9]+v[-10])/10
v10v50 = ((v10/v50[0])*100);
oh = 100-((c/hiqc)*100);
chg = (c[0]-c[-1])
opengraph(2);
sizegraph(2,1);
graph(1,' '+format(c[0],'$%5.2f')+' is '+format(oh,'%2.2f%')+
' off '+format(hiqc[0],'$%5.2f')+' high. Change= '+format(chg,'$%2.2f')
+' 15%Rg='+format(t15,'%2.f')
+' days. 20%Rg='+format(t20,'%2.f')+' days. 25%Rg='
+format(t25,'%2.f')+' days.');
if t15 >= 30 then goto draw15;
if t20 >= 40 then goto draw20;
if t25 >= 60 then goto draw25;
goto volgraph;
:draw25
drawline(9,0,lo25[-1],0,lo25[-1],-t25,-1);
drawline(9,0,hi25[-1],0,hi25[-1],-t25,-1);
goto volgraph;
:draw20
drawline(2,0,lo20[-1],0,lo20[-1],-t20,-1);
drawline(2,0,hi20[-1],0,hi20[-1],-t20,-1);
goto volgraph;
:draw15
drawline(12,0,lo15[-1],0,lo15[-1],-t15,-1);
drawline(12,0,hi15[-1],0,hi15[-1],-t15,-1);
goto volgraph;
:volgraph
graph(v,'Today='+format(v[0],'%5.f')+' 50MA='+format(v50[0],'%5.f')
+' %Today='+format(vv50,'%4.f%')+' 5MA='+format(v5v50,'%4.f%')
+' of 50MA. 10MA='+format(v10v50,'%4.f%')+' of',v50,'50MA');
closegraph();
writeln(fullname,' ',c[0],' ',chg,int(oh),'%',int(t15),int(t20),int(t25)
,' ',v[0],' ',int(vv50),'%');
return;